#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <assert.h>

int my_strncmp(const char* arr1, const char* arr2, int n)
{
	assert(*arr1 && *arr2);
	for (int i = 0; i < n; i++)
	{
		if (*arr1 != *arr2)
		{
			return *arr1 - *arr2;
		}
		else
		{
			if (*arr1 == '\0')
			{
				return 0;
			}
		}
		arr1++;
		arr2++;
	}
	return 0;
}

int main()
{
	char arr1[] = "abc";
	char arr2[] = "abc";
	int a = my_strncmp(arr1, arr2, 5);
	printf("%d", a);
	return 0;
}